import Base from "./base";
const api = new Base();
// 下单
export const addOrder = (data: any) => api.post("/sysOrder", data);
// 备货中
export const stockOrder = (id: string) => api.post(`/sysOrder/stocking/${id}`);
// 已取货
export const pickedUpOrder = (id: string) => api.post(`/sysOrder/pickedUp/${id}`);
// 待取货
export const pickUpOrder = (id: string) => api.post(`/sysOrder/pickUp/${id}`);
// 付款
export const payOrder = (id: string) => api.post(`/sysOrder/pay/${id}`);
// 配送中
export const deliveryOrder = (id: string) => api.post(`/sysOrder/delivery/${id}`);
// 已送达
export const deliveredOrder = (id: string) => api.post(`/sysOrder/delivered/${id}`);
// 取消订单
export const cancelOrder = (id: string) => api.post(`/sysOrder/cancel/${id}`);
// 退货
export const backOrder = (id: string) => api.post(`/sysOrder/back/${id}`);


// 购物车下单
export const addCartOrder = (ids: any[]) => api.post(`/sysOrder/cart`, ids);
// 订单详情
export const getOrder = (id: string) => api.get(`/sysOrder/${id}`);
// 我的订单列表
export const getOrderList = (data: any) => api.get("/sysOrder/page", data);
// 农户查看订单列表
export const getFarmOrderList = (data: any) => api.get("/sysOrder/pageByFarmer", data);
// 团长查看订单列表
export const getLeaderOrderList = (data: any) => api.get("/sysOrder/pageByLeader", data);
// 根据订单编号查询
export const getOrderByCode = (orderNo: string) => api.get(`/sysOrder/getByOrderNo/${orderNo}`);
// 团购下单
export const addRuleOrder = (id: string) => api.post(`/sysOrder/group/${id}`);


// 团购报名
export const registerRule = (ruleId: string) => api.post(`/ruleUser/${ruleId}`);

